package server

import (
	"6-17yk/common/model/mysql"
	"6-17yk/common/proto/user"
)

func UserDoctorList(req *user.UserDoctorListReq) (*user.UserDoctorListResp, error) {
	list, err := mysql.UserDoctorList()
	if err != nil {
		return nil, err
	}
	var lists []*user.UserDoctorList
	for _, doctor := range list {
		lists = append(lists, &user.UserDoctorList{
			Userid:     int64(doctor.Userid),
			DoctorId:   int64(doctor.DoctorId),
			DoctorName: doctor.DoctorName,
		})
	}
	return &user.UserDoctorListResp{List: lists}, nil
}
